create external table jms_dm.dm_terminal_tran_direct_delivery_detail_dt 
(
waybill_no                     string COMMENT '运单号' ,
package_code                   string COMMENT '包号' ,
scan_time                      string COMMENT '扫描时间' ,
package_type                   string COMMENT '包类型' ,
third_package_code             string COMMENT '包三段码' ,
second_package_code            string COMMENT '包二段吗' ,
report_time                    string COMMENT '错分上报时间' ,
is_ass                         string COMMENT '是否错分' ,
end_provider_id                string COMMENT '末端网点所属省ID' ,
end_provider_name              string COMMENT '末端网点所属省' ,
end_city_id                    string COMMENT '末端网点所属城市id' ,
end_city_name                  string COMMENT '末端网点所属城市' ,
end_area_id                    string COMMENT '末端网点所属区县ID' ,
end_area_name                  string COMMENT '末端网点所属区县' ,
end_agent_code                 string COMMENT '末端代理区code' ,
end_agent_name                 string COMMENT '末端代理区名字' ,
end_center_code                string COMMENT '末端中心code' ,
end_center_name                string COMMENT '末端中心名字' ,
end_network_arrival_time       string COMMENT '末端网点到件时间' ,
final_sign_network_code        string COMMENT '规划签收网点code' ,
final_sign_network_name        string COMMENT '规划签收网点' ,
third_code                     string COMMENT '运单三段码' ,
code                           string COMMENT '三段码维护的三段码(出仓单元区域号)' ,
is_right_third_code            string COMMENT '三段码是否准确' ,
deliver_time                   string COMMENT '出仓时间' ,
aging_sign_time                string COMMENT '时效签收时间' ,
final_plan_sign_time           string COMMENT '规划签收时间' ,
actual_sign_time               string COMMENT '实际签收时间' ,
end_center_send_time           string COMMENT '末端中心发件时间' ,
difficult_type                 string COMMENT '问题件类型' ,
difficult_time                 string COMMENT '问题件时间' ,
deliver_scan_user_code         string COMMENT '出仓扫描员code' ,
deliver_scan_user                         string COMMENT '出仓扫描员' ,
deliver_user_code                         string COMMENT '出仓派件员code' ,
deliver_user                              string COMMENT '出仓派件员' ,
site_scan_user_code                       string COMMENT '网点扫描员' ,
site_scan_user_name                       string COMMENT '网点扫描员' ,
center_scan_user_code                     string COMMENT '中心扫描员' ,
center_scan_user_name                     string COMMENT '中心扫描员' ,
is_send_noarrival                         string COMMENT '是否是有发未到' ,
center_send_sign_hours                    string COMMENT '发签时长' ,
arrival_send_hours                        string COMMENT '到发时长' ,
deliver_sign_hours                        string COMMENT '派签时长' ,
is_arrival_send                           string COMMENT '是否到出一体' ,
date_time                                 string COMMENT '业务日期',
end_franchisee_code string comment  '加盟商code',
end_franchisee_name string comment  '加盟商'
)
comment '转运直送明细'
PARTITIONED BY ( dt string COMMENT '时间分区')
stored as parquet
LOCATION '/dw/hive/jms_dm.db/external/dm_terminal_tran_direct_delivery_detail_dt'
TBLPROPERTIES (
           'discover.partitions' = 'false',
           'parquet.column.index.access' = 'true'
           );
alter table jms_dm.dm_terminal_tran_direct_delivery_detail_dt add columns (
   send_next_station_code string comment '拆包网点code'
  ,send_next_station_name string comment '拆包网点'
    )cascade ;